#include "card.h"

Card::Card(QWidget *parent):QWidget(parent)
{
    this->setGeometry(0,0,100,173);
}

Card::~Card()
{

}

double randomplace()
{
    return QRandomGenerator::global()->bounded(500.00);
}

double randomtime()
{
    return QRandomGenerator::global()->bounded(5.00);
}

void Card::paintEvent(QPaintEvent *event)
{
    QPainter *painter3 =new QPainter(this);
    QPixmap pixcard;
    pixcard.load(":/res/CardBack2.png");
    painter3->drawPixmap(0,0,100,173,pixcard);
    painter3->end();
}

void Card::mousePressEvent(QMouseEvent *event)
{
    Q_UNUSED(event);
    emit sendSelf(this);                                  //信号发送该控件地址

}

void Card::mouseDoubleClickEvent(QMouseEvent *event)
{
    this->hide();
}

